package com.gddb.xwj.mywiki.config;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 *  ComponentScan("com.gddb.xwj.mywiki") 默认是自动扫描 SpringBootApplication注解目录 如果是上层需加声明
 *  MapperScan("com.gddb.xwj.mywiki.mapper") 声明mapper是持久层
 */
@ComponentScan("com.gddb.xwj.mywiki")
@MapperScan("com.gddb.xwj.mywiki.mapper")
@SpringBootApplication
@Slf4j
public class MywikiApplication {

    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(MywikiApplication.class);
//        application.setBannerMode(Banner.Mode.OFF);//关闭banner图案显示
        ConfigurableEnvironment env = application.run(args).getEnvironment();
        log.info("启动成功！！");
        log.info("地址: \thttp://127.0.0.1:{}", env.getProperty("server.port"));
    }

}
